package com.neusoft.neuiotms.dcom.converter;

import org.springframework.stereotype.Component;

import com.neusoft.bizcore.web.dto.AbstractConverter;
import com.neusoft.neuiotms.dcom.dto.MonthValueAddedDTO;
import com.neusoft.neuiotms.dcom.model.MonthValueAdded;

@Component
public class MonthValueAddedConverter extends AbstractConverter<MonthValueAdded, MonthValueAddedDTO> {

    @Override
    public MonthValueAdded toModel(final MonthValueAddedDTO dto) {

        final MonthValueAdded model = new MonthValueAdded();

        model.setLocation(dto.getLocation());
        model.setOperationName(dto.getOperationName());
        model.setOperationCode(dto.getOperationCode());
        model.setRequester(dto.getRequester());
        model.setServiceDesc(dto.getServiceDesc());
        model.setServiceTime(dto.getServiceTime());
        model.setStatus(dto.getStatus());
        return model;
    }

    @Override
    public MonthValueAddedDTO toDTO(final MonthValueAdded model, final boolean forListView) {

        final MonthValueAddedDTO dto = new MonthValueAddedDTO();

        dto.setId(model.getId());
        dto.setLocation(model.getLocation());
        dto.setOperationName(model.getOperationName());
        dto.setOperationCode(model.getOperationCode());
        dto.setRequester(model.getRequester());
        dto.setServiceDesc(model.getServiceDesc());
        dto.setServiceTime(model.getServiceTime());
        dto.setStatus(model.getStatus());

        return dto;
    }

}
